//
//  RBFollowViewController.m
//  Budejie
//
//  Created by 华杨科技 on 2017/9/19.
//  Copyright © 2017年 饶波. All rights reserved.
//  关注

#import "RBFollowViewController.h"
#import "RBRecomendFollowViewController.h"
#import "RBRegisterLoginViewController.h" 

@interface RBFollowViewController ()
/**
 占位文字颜色
 */
@property (nonatomic, strong) UITextField *textfield;
@end

@implementation RBFollowViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = RBCommonbgcolor;
    
    // UINavigationItem : NSObject
    // UIBarButtonItem : UIBarItem
    
    // 标题（不建议使用self.title）
    self.navigationItem.title = @"我的关注";
    // 左边    
    UIBarButtonItem *leftItem = [UIBarButtonItem itemWithImage:@"friendsRecommentIcon" highlightImage:@"friendsRecommentIcon-click" target:self action:@selector(followClickAction)];    
    
    self.navigationItem.leftBarButtonItem = leftItem;
    
    UITextField *textField = [[UITextField alloc] init];
    textField.frame = CGRectMake(100, 100, 150, 50);
    textField.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:textField];
    textField.placeholder = @"请输入手机号";
    textField.placeholderColor = [UIColor redColor];
    self.textfield = textField;
    
    NSLog(@"%@ %@",[UIColor colorWithRed:0.5 green:0.5 blue:0.8 alpha:0.23],self.textfield.placeholderColor);
}



- (IBAction)registerAndLoginAction {
    
    self.textfield.placeholderColor = nil;
    NSLog(@"self.textfield.placeholderColor:%@",self.textfield.placeholderColor);
    self.view = nil;
    NSLog(@"self.view:%@",self.view);

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        RBRegisterLoginViewController *registerLoginVC = [[RBRegisterLoginViewController alloc] initWithNibName:@"RBRegisterLoginViewController" bundle:nil];
        [self presentViewController:registerLoginVC animated:YES completion:nil];    
    });
}

- (void)followClickAction {
    RBNSLogFunction
    
    RBRecomendFollowViewController *recomendVC = [RBRecomendFollowViewController new];
    //    recomendVC.hidesBottomBarWhenPushed = YES;
    //    self.hidesBottomBarWhenPushed = YES; // 这样设置是有问题 //http://www.jianshu.com/p/4c94fc74f1e6
    
    [self.navigationController pushViewController:recomendVC animated:YES];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [self.view endEditing:YES];
}

@end
